"""
URL configuration for main project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from credits import views as credits_views
from stores import views as stores_views
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('home.urls')),
    path('credits/', include('credits.urls')),

    path('mall', credits_views.mall, name='mall'),
    path('stores', stores_views.nearby_shops, name='stores'),
    path('account/', include('account.urls')),
    path('stores/', include('stores.urls')),
    path('employee/', include('distribution.urls')),
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:  # 仅在调试模式启用
    import debug_toolbar
    urlpatterns += [
        path('__debug__/', include(debug_toolbar.urls)),  # 添加调试路由
    ]

# CKEditor 5 文件上传 URL
urlpatterns += [
    path("ckeditor5/", include('django_ckeditor_5.urls')),
]